package com.example.ppapp.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.TextView;
import android.widget.Toast;

import com.example.ppapp.R;

public class ShoppingPayActivity extends AppCompatActivity implements View.OnClickListener {

        private ImageView img_back;
        private TextView tv_title;
        private RadioButton rb_zfb;
        private RadioButton rb_hdfk;
        private TextView et_name;
        private TextView et_phone;
        private TextView et_address;
        private ImageView img_edit;
        private TextView et_running_money;
        private TextView et_sum;
        private Button btn_cancel;
        private Button btn_pay;

@Override
protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_shopping_pay);
        initView();

        }

private void initView() {
        img_back = (ImageView) findViewById(R.id.img_back);
        tv_title = (TextView) findViewById(R.id.tv_title);
        rb_zfb = (RadioButton) findViewById(R.id.rb_zfb);
        rb_hdfk = (RadioButton) findViewById(R.id.rb_hdfk);
        et_name = (TextView) findViewById(R.id.et_name);
        et_phone = (TextView) findViewById(R.id.et_phone);
        et_address = (TextView) findViewById(R.id.et_address);
        img_edit = (ImageView) findViewById(R.id.img_edit);
        et_running_money = (TextView) findViewById(R.id.et_running_money);
        et_sum = (TextView) findViewById(R.id.et_sum);
        btn_cancel = (Button) findViewById(R.id.btn_cancel);
        btn_pay = (Button) findViewById(R.id.btn_pay);

        tv_title.setText("支付");

        btn_cancel.setOnClickListener(this);
        btn_pay.setOnClickListener(this);
        img_edit.setOnClickListener(this);
        img_back.setOnClickListener(this);

        rb_zfb.setChecked(true);
        }

@Override
public void onClick(View v) {
        switch (v.getId()) {
        case R.id.btn_pay:
        Toast.makeText(this, "支付成功", Toast.LENGTH_SHORT).show();
        break;
        case R.id.img_back:
        case R.id.btn_cancel:
        onBackPressed();
        finish();
        break;
        case R.id.img_edit:
        Toast.makeText(this, "地址", Toast.LENGTH_SHORT).show();
        break;
        }
        }

        }